﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master Resources/XLMaster.Master"
    AutoEventWireup="true" CodeBehind="ViewOrder.aspx.cs" Inherits="XclusiveClient.ViewOrder" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Content" runat="server">
    <h1 style="text-align: center">
        View All Orders</h1>
    <br />
    <div id="wrapper-v2" style="margin-left: 20px; text-align: center; width: 850px">
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="orderID"
            DataSourceID="XclusiveDataSource">
            <Columns>
                <asp:BoundField DataField="orderID" HeaderText="Order ID" InsertVisible="False" ReadOnly="True"
                    SortExpression="orderID" />
                <asp:BoundField DataField="status" HeaderText="Order Status" SortExpression="status" />
                <asp:BoundField DataField="ship_date" HeaderText="Ship Date" SortExpression="ship_date" />
                <asp:BoundField DataField="ship_time" HeaderText="Ship Time" SortExpression="ship_time" />
                <asp:BoundField DataField="ship_type" HeaderText="Ship Type" SortExpression="ship_type" />
                <asp:BoundField DataField="address" HeaderText="Shipment Destination Address" SortExpression="address" />
                <asp:BoundField DataField="employeeID" HeaderText="Employee In-Charge" SortExpression="employeeID" />
                <asp:BoundField DataField="listID" HeaderText="List ID" SortExpression="listID" />
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="XclusiveDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:XclusiveConnectionString2 %>"
            SelectCommand="SELECT [orderID], [status], [ship_date], [ship_time], [ship_type], [address], [employeeID], [listID] FROM [Order]">
        </asp:SqlDataSource>
        <br />
    </div>
    <br />
    <br />
    <h1 style="text-align: center">
        Search for Specific Order</h1>
    <table style="margin-left: 170px">
        <tr>
            <td style="text-align: right; padding-top: 18px">
                Order ID:
            </td>
            <td style="float: left; padding-top: 13px">
                <asp:TextBox ID="tbxOrderID" runat="server"></asp:TextBox>
            </td>
            <td style="float: left">
                <asp:Button ID="btnRetrieveById" runat="server" Text="Search" OnClick="btnRetrieveById_Click" />
            </td>
        </tr>
    </table>
    <div style="text-align: center">
        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" Display="Dynamic"
            ErrorMessage="*Order ID Is Required" ControlToValidate="tbxOrderID" ForeColor="Red"></asp:RequiredFieldValidator>
        <br />
        <asp:Label ID="LblResult" runat="server" ForeColor="Red"></asp:Label>
    </div>
    <br />
    <div id="wrapper-v2" style="margin-left: 20px; text-align: center; width: 850px">
        <table>
            <tr>
                <td>
                    <b>Order ID</b>
                </td>
                <td>
                    <b>Order Status</b>
                </td>
                <td>
                    <b>Ship Date</b>
                </td>
                <td>
                    <b>Ship Time</b>
                </td>
                <td>
                    <b>Ship Type</b>
                </td>
                <td>
                    <b>Shipment Destination Address</b>
                </td>
                <td>
                    <b>Employee In-Charge</b>
                </td>
                <td>
                    <b>List ID</b>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="LblOrderID" runat="server"></asp:Label>
                </td>
                <td>
                    <asp:Label ID="LblStatus" runat="server"></asp:Label>
                </td>
                <td>
                    <asp:Label ID="LblDate" runat="server"></asp:Label>
                </td>
                <td>
                    <asp:Label ID="LblTime" runat="server"></asp:Label>
                </td>
                <td>
                    <asp:Label ID="LblType" runat="server"></asp:Label>
                </td>
                <td>
                    <asp:Label ID="LblAddress" runat="server"></asp:Label>
                </td>
                <td>
                    <asp:Label ID="LblEmpID" runat="server"></asp:Label>
                </td>
                <td>
                    <asp:Label ID="LblListID" runat="server"></asp:Label>
                </td>
            </tr>
        </table>
    </div>
</asp:Content>
